Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
global-modules
Advanced tools
The global-modules npm package provides the location of the globally installed npm packages on the user's system. It is a simple utility that can be used to find out where global npm packages are stored, which can vary depending on the operating system and the configuration of the npm environment.
Get the path to global node_modules
This feature allows you to retrieve the path to the directory where global npm packages are installed. The code sample shows how to import the global-modules package and log the path to the console.
const globalModules = require('global-modules');
console.log(globalModules);
The global-prefix package is similar to global-modules in that it provides the location of the global npm prefix, which is the directory where global packages are installed. However, global-prefix focuses on the prefix path itself rather than the node_modules directory.
The global-npm package can locate the npm binary that is installed globally on the system. While it serves a different purpose than global-modules, it is related in the sense that it deals with global npm installations.
The which-pm-runs package is used to detect which package manager is currently running the script. It is not directly related to finding the location of global modules, but it is useful in a global npm context to understand which package manager is in use.
The directory used by npm for globally installed npm modules.
Install with npm:
$ npm install --save global-modules
var dir = require('global-modules');
//=> '/usr/local/lib/node_modules' (depends on OS)
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
(This document was generated by verb-generate-readme (a verb generator), please don't edit the readme directly. Any changes to the readme must be made in .verb.md.)
To generate the readme and API documentation with verb:
$ npm install -g verb verb-generate-readme && verb
Install dev dependencies:
$ npm install -d && npm test
Jon Schlinkert
Copyright © 2016, Jon Schlinkert. Released under the MIT license.
This file was generated by verb, v0.9.0, on July 26, 2016.
FAQs
The directory used by npm for globally installed npm modules.
The npm package global-modules receives a total of 15,475,641 weekly downloads. As such, global-modules popularity was classified as popular.
We found that global-modules demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.